/*
 * JANN - a Java toolkit for creating arbitrary Artificial Neural Networks.
 * 
 * Copyright (c) 2009 Matthijs Snel
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package net.jann;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;


public class Parameters {
	public static final String ALPHA = "alpha",
								LEARNING_RATE = "learning rate",
								MOMENTUM = "momentum",
								RNG = "rng";
	
	protected Map<String, Object> parameters;
	
	public Parameters() {
		init();
	}
	
	public Parameters( Map<String, ? extends Object> params ) {
		parameters = new HashMap<String, Object>( params.size() );
		parameters.putAll( params );
	}
	
	public Object get( String key ) {
		return parameters.get(key);
	}
		
	public void set( String key, Object value ) {
		parameters.put(key, value);
	}
	
	protected void init() {
		parameters = new HashMap<String, Object>();
		parameters.put(ALPHA, new Double(0));
		parameters.put(LEARNING_RATE, new Double(0.1));
		parameters.put(MOMENTUM, new Double(0));
		parameters.put(RNG, new Random(System.currentTimeMillis()));
	}
}
